package com.wyw.hemerocallis.permission;

import com.wyw.hemerocallis.permission.vo.CheckPermissionRequest;
import com.wyw.hemerocallis.permission.vo.CreatePathRequest;
import com.wyw.hemerocallis.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 路径创建与权限校验功能 Feign 接口实现
 *
 * @author Mr Wu    yewen.wu.china@gmail.com
 * <p>
 * Update History:
 * Author        Time            Content
 */
@FeignClient(value = "nacos-hemerocallis-permission")
public interface PermissionClient {

    @RequestMapping(value = "/hemerocallis-permission/create/path",
            method = RequestMethod.POST)
    CommonResponse<List<Integer>> createPath(
            @RequestBody CreatePathRequest request
    );

    @RequestMapping(value = "/hemerocallis-permission/check/permission",
            method = RequestMethod.POST)
    Boolean checkPermission(@RequestBody CheckPermissionRequest request);
}
